<template>
  <b-container>
    <b-row id="list_row">
      <b-col v-for="(arcticle, index) in arcticles" :key="index">
        <article-card :arcticle="arcticle" />
      </b-col>
    </b-row>
  </b-container>
</template>

<script>
import ArticleCard from "../ArticleCard.vue";
export default {
  name: "ArticleList",
  data() {
    return {
      arcticles: [],
    };
  },
  components: {
    ArticleCard,
  },
  methods: {},
  mounted() {
    if (!this.$route.query.current) {
      return;
    }

    this.$axios
      .get(this.$store.state.arcticleListUrl, {
        params: {
          current: this.$route.query.current,
        },
      })
      .then(
        (res) => {
          this.arcticles = res.data;
        },
        (error) => {
          console.log(error.message);
        }
      );
  },
};
</script>

<style scoped>
</style>